<!--
 * @Author: coman
 * @LastEditors: coman
 * @Date: 2020-06-16 16:17:00
 * @motto: No pain,No gain
 * @LastEditTime: 2020-06-16 16:42:14
--> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 选择排序 -->
   
    <script>
         var arr = [4,9,3,77,54,36,99];
         for(var i=0;i<arr.length;i++){
            var min = i;
            for(var j=i+1;j<arr.length;j++){
            if(arr[min]>arr[j]){
                min =j;
            }
            
        }
        var temp = arr[min];
        arr[min] =arr[i];
        arr[i] =temp;
         }
         console.log("选择排序"+arr);
         
    </script>
</body>
</html>